{include file="common/header"}

<!-- 编辑器 -->
<script charset="utf-8" src="/Public/library/kindeditor/kindeditor-all-min.js"></script>
<script charset="utf-8" src="/Public/library/kindeditor/lang/zh-CN.js"></script>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
       
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                   <div class="ibox-title">
                            <h5>规则添加</h5>
                    </div>
                    <div class="ibox-content">
                        <form class="form-horizontal m-t" id="partner" enctype="multipart/form-data">
                            <div class="form-group">
                                <label class="col-sm-3 control-label">名称：</label>
                                <div class="col-sm-8">
                                    <input id="cname" name="title" type="text" class="form-control" required="" aria-required="true">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">路径：</label>
                                <div class="col-sm-8">
                                    <input id="cname" name="path" type="text" class="form-control" placeholder="例：Index/index" required="" aria-required="true">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">状态：</label>
                                <div class="col-sm-8">
                                    <select class="input-sm form-control input-s-sm inline" name="status" style="width:80px;height: 33px;">
                                        <option value="1">启用</option>
                                        <option value="2">禁用</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group form-group-bottom">
                                <div class="col-sm-2 col-sm-offset-3">
                                    <p class="btn btn-primary" onclick="submitAdd();">确定添加</p>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            
            </div>
           
        </div>
    </div>
</body>
{include file="common/footer"}
<script>
    //按钮样式
    $(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});

    //添加会员
    function submitAdd(){
        $.ajax({
            url: "/Admin/Auth/auth_add",
            data:$('#partner').serialize(),
            type: "POST",
            dataType:'json',
            success: function (d) {
                if(d){
                    if(d.error){
                        swal(d.msg, "", "warning");
                        return false;
                }else{
                        swal(d.msg, "", "success");
                        //window.location.href="/admin/news/list";
                        setTimeout("window.location.reload()",1000);
                    }
                }
            }
        })

    }
</script>
